import http from "@/common/api/request"
import qs from "qs"

// 提交订单
export const submitOrder = (orderId, shopArr) => {
   return http.$axios(
        {
            url: '/api/submitOrder',
            method: 'POST',
            data: {
                orderId,
                shopArr,
            },
            headers: {
                token: true,
                // 'Content-Type': 'application/x-www-form-urlencoded'
            }

        }
    )

}

// 支付接口
export const payment = (data) => {
    // qs更安全的序列化
    
    
    
    return http.$axios(
         {
             url: '/api/payment',
             method: 'POST',
             data:qs.stringify(data),
             headers: {
                 token: true,
                 'Content-Type': 'application/x-www-form-urlencoded'
             }
 
         }
     )
 
 }

//  获取支付状态信息
 export const GetPaymentData = (datas) => {

   
    return http.$axios(
         {
             url: '/api/successPayment',
             method: 'POST',
             data:qs.stringify(datas),
             headers: {
                 token: true,
                 'Content-Type': 'application/x-www-form-urlencoded'
             }
 
         }
     )
 
 }